package com.bigstonecontainer.training.springboot.frm.server.sys.service.impl;

import com.bigstonecontainer.training.springboot.frm.server.sys.domain.SysUser;
import com.bigstonecontainer.training.springboot.frm.server.sys.mapper.SysUserMapper;
import com.bigstonecontainer.training.springboot.frm.server.sys.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class SysUserServiceImpl implements SysUserService {

    @Autowired
    private SysUserMapper sysUserMapper;

    @Override
    public List<SysUser> getList() {
        return sysUserMapper.getList();
    }

    @Override
    public SysUser getOne(Long id) {
        return sysUserMapper.getOne(id);
    }

    @Override
    public int create(SysUser user) {
        return sysUserMapper.insert(user);
    }

    @Override
    public int updateById(SysUser user) {
        return sysUserMapper.updateById(user);
    }

    @Override
    public int deleteById(Long id) {
        return sysUserMapper.deleteById(id);
    }
}
